home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / Q-R / QDPat.cpt / Utilities < prev   
Encoding:
Text File  |  1989-10-22  |  1.7 KB  |  68 lines  |  [TEXT/PJMM]

  1. unit Utilities;
  2.  
  3. interface
  4.  
  5.     uses
  6.         InitTheMenus, Globals;
  7.  
  8.     procedure Wait (x: integer);
  9.     function Randomize (range: integer): integer;
  10.     procedure ResetWindow;
  11.  
  12. implementation
  13.  
  14.     procedure Wait (x: integer);
  15.         var
  16.             dummy: longint;
  17.     begin
  18.         delay(x, dummy);
  19.     end;   {...Wait procedure}
  20.  
  21.     function Randomize (range: integer): integer;
  22.  
  23.     begin
  24.         Randomize := (abs(Random) mod range) + 1
  25.     end;
  26.  
  27.     procedure ResetWindow;
  28.         procedure Renit_My_Menus;            {Initialize the menus}
  29.  
  30.             var
  31.                 AppleMenu: MenuHandle;           {Menu handle}
  32.                 M_File: MenuHandle;              {Menu handle}
  33.                 M_Edit: MenuHandle;              {Menu handle}
  34.                 M_Shapes: MenuHandle;            {Menu handle}
  35.  
  36.             const
  37.                 Menu1 = 1001;                   {Menu resource ID}
  38.                 Menu2 = 1002;                   {Menu resource ID}
  39.                 Menu3 = 1003;                   {Menu resource ID}
  40.                 Menu4 = 1004;                   {Menu resource ID}
  41.  
  42.         begin                               {Start of Init_My_Menus}
  43.             ClearMenuBar;                   {Clear any old menu bars}
  44.  
  45.         { This menu is the APPLE menu, used for About and desk accessories.}
  46.             AppleMenu := GetMenu(Menu1);{Get the menu from the resource file}
  47.             InsertMenu(AppleMenu, 0);       {Insert this menu into the menu bar}
  48.  
  49.             M_File := GetMenu(Menu2);       {Get the menu from the resource file}
  50.             InsertMenu(M_File, 0);          {Insert this menu into the menu bar}
  51.  
  52.             M_Edit := GetMenu(Menu3);       {Get the menu from the resource file}
  53.             InsertMenu(M_Edit, 0);          {Insert this menu into the menu bar}
  54.  
  55.             M_Shapes := GetMenu(Menu4);{Get the menu from the resource file}
  56.             InsertMenu(M_Shapes, 0);        {Insert this menu into the menu bar}
  57.  
  58.             DrawMenuBar;                    {Draw the menu bar}
  59.  
  60.         end;                                    {End of procedure Init_My_Menus}
  61.  
  62.  
  63.     begin
  64.         ShowDrawing;
  65.         Renit_My_Menus;
  66.     end;
  67.  
  68. end.